package com.examination.client.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 日志工具
 * Created by liangtao on 2020/3/10
 */
public class LogUtil {

    private Logger logger;

    public LogUtil(Class c) {
        this.logger = LoggerFactory.getLogger(c);
    }

    /**
     * 规范info日志
     * @param orderNo  单号
     * @param action   行为
     * @param message  信息主体
     * @param response 响应信息
     */
    public void info(String orderNo, String action, String message, String response){
        this.logger.info("order no {} ----> action: {}, message: {}, response: {}", orderNo, action, message, response);
    }

    /**
     * 包装原生info方法
     */
    public void info(String message, Object... arguments) {
        this.logger.info(message, arguments);
    }

    /**
     * 包装原生debug方法
     */
    public void debug(String message, Object... arguments) {
        this.logger.debug(message, arguments);
    }

    /**
     * 包装原生error方法
     */
    public void error(String message, Object... arguments) {
        this.logger.error(message, arguments);
    }
}
